<?php
/* @var $this TermsController */
/* @var $model Terms */
/* @var $form CActiveForm */
?>

<div class="form ml34">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'terms-form',
	'enableAjaxValidation'=>false,
)); ?>

	<div class="row">Fields with <span class="required">*</span> are required.</div>

	<div class="row">
	<?php echo $form->errorSummary($model); ?>
	</div>

	<div class="row">
	<?php if (!empty($categoryID))
		$model->categoryID = $categoryID;
?>
		<?php echo $form->labelEx($model,'categoryID'); ?>
		<?php echo $form->dropDownList($model,'categoryID',CHtml::listData(Categories::getList("CATEGORY-LIST"), "categoryID", "category_name"),array('empty'=>'Select Category')); ?>
		<?php echo $form->error($model,'categoryID'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'parentID'); ?>
		<?php echo $form->dropDownList($model,'parentID',CHtml::listData(Terms::getList("PARENT-LIST",array('categoryID'=>$model->categoryID)), "termID", "term_name"),array('empty'=>'Select Parent')); ?>
		<?php echo $form->error($model,'parentID'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'term_name'); ?>
		<?php echo $form->textField($model,'term_name',array('size'=>60,'maxlength'=>300)); ?>
		<?php echo $form->error($model,'term_name'); ?>
	</div>
	
	<div class="row form-actions">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class' => 'btn btn-primary')); ?>
		<?php echo CHtml::button('Cancel', array('submit' => ApplicationConfig::getURL("", "terms", "admin",array('id'=>$_GET['id'])),'class' => 'btn btn-primary')); ?>
		
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->